package com.attilax.io;

import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.junit.Test;

import com.alibaba.fastjson.JSON;
import com.attilax.Charset.EncodingDetect;
import com.attilax.collection.mapBuilder;
import com.attilax.core.ForeachFunction;
import com.attilax.fulltxt.fulltxtServ;
import com.attilax.str.Strutil;
import com.attilax.text.strUtil;
import com.attilax.util.serilizeUtil;
import com.cnhis.cloudhealth.module.log.Cls1;
import com.google.common.collect.Lists;
@SuppressWarnings("all")
public class DirTraveServiceTest {

	@Test
	public final void testTraveV4Vs427() {
		try {
			System.out.println( FileUtils.readFileToString(new File("l:\\log.log")));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public final void testTrave_throwEx() {
//		 idle_flush_time =>1
//				 	workers =>2
//				 		flush_interval=>1
	}

	public static Logger logger = Logger.getLogger(Cls1.class);

	@Test
	public final void testTrave_v5() {
		final Logger logger = Logger.getLogger(Cls1.class);
		final List li = Lists.newArrayList();
		String dir = "C:\\d\\placeholderIndex v3 s524";
	//	List<String> li=Lists.newArrayList();
		new DirTraveService().traveV5_vS522(new File(dir), new ForeachFunction() {

			@Override
			public void each(int count, File f) throws Exception {
			 
			    
			   if(count%1000==0)
				
				logger.info( "cn:"+count+f);
			   FileUtils.write(f, "");
				String rltpath = f.getAbsolutePath().substring(dir.length() + 1);
			   li.add(rltpath);

			}

		});
		  serilizeUtil.seriz(li, "C:\\d\\10wfileObjSeri");
		
System.out.println("--0");
	}

}
